<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改订单')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-order-edit" th:object="${sysOrder}">
            <input name="orderId" th:value="${sysOrder.orderId}" type="hidden">
            <input name="userId" th:value="${sysOrder.userId}" type="hidden">
            <div class="form-group">
                <label class="col-sm-3 control-label">创建人：</label>
                <div class="col-sm-8">
                    <input th:value="${sysOrder.orderName}" class="form-control" type="text" disabled>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">创建时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="orderCreateDate" th:value="${#dates.format(sysOrder.orderCreateDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">修改时间：</label>
                <div class="col-sm-8">
                    <div class="input-group date">
                        <input name="orderUpdateDate" th:value="${#dates.format(sysOrder.orderUpdateDate, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text" disabled>
                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                    </div>
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单金额：</label>
                <div class="col-sm-8">
                    <input name="orderPrice" th:value="${sysOrder.orderPrice}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">    
                <label class="col-sm-3 control-label">订单备注：</label>
                <div class="col-sm-8">
                    <input name="orderRemark" th:value="${sysOrder.orderRemark}" class="form-control" type="text">
                </div>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">订单编号：</label>
                <div class="col-sm-8">
                    <input name="orderNum" th:value="${sysOrder.orderNum}" class="form-control" type="text" disabled>
                </div>
            </div>

            <div class="form-group">
                <label class="col-sm-3 control-label">订单状态：</label>
                <div class="col-sm-9">
                    <label class="radio-box">
                        <input type="radio" value="1" id="optionsRadios1" name="orderState" th:checked="${sysOrder.orderState == 1 ? true : false}">已提交</label>
                    <label class="radio-box">
                        <input type="radio" value="2" id="optionsRadios2" name="orderState" th:checked="${sysOrder.orderState == 2 ? true : false}">已支付</label>
                    <label class="radio-box">
                        <input type="radio" value="3" id="optionsRadios3" name="orderState" th:checked="${sysOrder.orderState == 3 ? true : false}">已取消</label>
                    <label class="radio-box">
                        <input type="radio" value="4" id="optionsRadios4" name="orderState" th:checked="${sysOrder.orderState == 4 ? true : false}">已完成</label>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/order";
        $("#form-order-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-order-edit').serialize());
            }
        }

        $("input[name='orderCreateDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='orderUpdateDate']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>